<?php
/**
 * Created by PhpStorm.
 * User: Auser
 * Date: 2016/12/14
 * Time: 10:05
 */

namespace App\Repositories\Xjb;
use App\Models\Xjb\TestingXjbUserRecord;
use App\Repositories\Repository;
use Cache;

class TestingXjbUserRecordRepository extends Repository
{
    static $tag = 'testing.xjb.user.record';

    //插入结果集
    public function stroeResult($data){
        return TestingXjbUserRecord::create($data);
    }

    //根据uid获取用户测评结果
    public function getByUid($uid,$tid){
        return TestingXjbUserRecord::where('uid', $uid)
            ->where('tid',$tid)
            ->orderBy('created_at', 'desc')
            ->first();
    }


    public function model()
    {
        return app(TestingXjbUserRecord::class);
    }

    public function tag()
    {
        return self::$tag;
    }

}